/*
 * toshiba-pmfix - Hotfix for suspend/resume issues on Toshiba Portege z930
 *                 and similar labtops.
 *
 * Written by Alexander Pevzner <pzz@apevzner.com>, 2013
 *
 * This code is Public Domain.
 * It can also be used under terms of Gnu Public License v2.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <acpi/acpi.h>

/*
 * Module initialization function
 */
int __init
init_module( void )
{
    printk( KERN_INFO "toshiba-pmfix: module loaded\n" );

    if( !(acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) )
    {
        printk( KERN_INFO "toshiba-pmfix: hotfix applied\n" );
        acpi_gbl_FADT.sleep_control.address = 0;
    }
    else
        printk( KERN_INFO "toshiba-pmfix: hotfix not required\n" );

    return 0;
}

/*
 * Module cleanup function
 */
void __exit
cleanup_module( void )
{
    printk( KERN_INFO "toshiba-pmfix: module unloaded\n" );
}

/*
 * Bureaucracy :-)
 */
MODULE_LICENSE( "GPL" );
MODULE_AUTHOR( "Alexander Pevzner" );
MODULE_DESCRIPTION( "Hotfix for suspend/resume issues on Toshiba z930" );


/* vim:ts=8:sw=4:et
 */
